<template>
  <div class="cart">
    <h2>Your Cart</h2>
    
  </div>
</template>

<script>
import { checkout } from '../store/actions'
import { cartProducts } from '../store/getters'

export default {
  vuex: {
    getters: {
      products: [],
      checkoutStatus: ({ cart }) => cart.lastCheckout
    },
    actions: {
      checkout
    }
  },
  computed: {
    total () {
      return this.products.reduce((total, p) => {
        return total + p.price * p.quantity
      }, 0)
    }
  }
}
</script>
